namespace Brjnk.Common
{
    using System.ComponentModel;

    /// <summary>
    /// </summary>
    public class CheckListItem<T> : INotifyPropertyChanged
    {
        public CheckListItem(T obj, bool isChecked)
        {
            this.obj = obj;
            IsChecked = isChecked;
        }

        private T obj;

        public T Object { get { return obj; } }

        private bool isChecked;

        public bool IsChecked
        {
            get { return isChecked; }
            set { isChecked = value; OnPropertyChanged("IsChecked"); }
        }

        private bool isSelected;

        public bool IsSelected
        {
            get { return isSelected; }
            set { isSelected = value; OnPropertyChanged("IsSelected"); }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        private void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}